<?php

namespace App\Model\organization;

use Illuminate\Database\Eloquent\Model;

class Grade extends Model
{
    //批量赋值
    protected $guarded = [];

    /**
     * 1年级n学院
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function colleges()
    {
        return $this->hasMany('App\Model\organization\College');
    }

    /**
     * 1年级n专业
     * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
     */
    public function majors()
    {
        return $this->hasManyThrough('App\Model\organization\Major', 'App\Model\organization\College');
    }
}
